import { defAxios as request } from '@/utils/http'

/**
 * 获取选择数据字段弹窗左侧树结构
 *
 * @returns axios
 */
export function getDataFieldTableList(req) {
  const reqAxios = req || request
  return reqAxios({
    url: "/formInfo/queryTableList",
    method: 'GET'
  })
}

/**
 * 获取表字段信息根据表名称
 *
 * @param {String} tableName 选中的表名称
 * @returns axios
 */
export function getDataFieldTableColumns(req,params) {
  const reqAxios = req || request
  return reqAxios({
    url: "/formInfo/queryColumnListByTableName",
    method: 'POST',
    data: params
  })
}

/**
 * 获取下拉选项基础数据可选数据表格
 *
 * @returns axios
 */
export function getBaseDataDictTableList(req) {
  const reqAxios = req || request
  return reqAxios({
    url: "/formInfo/queryFaspDicdsList",
    method: 'GET'
  })
}

export function getBaseDictData(req, params) {
  const reqAxios = req || request
  return reqAxios({
    url: "/dict/getDictData",
    method: 'POST',
    data: params,
  })
}
